<template>
	<view>
		<view class="quan" v-for="(item,index) in list">
			<view class="ti">
				店铺优惠券
			</view>
			<view class="price">
				<text>¥</text> {{item.price}}
			</view>
			<view class="use">
				满250元可使用
			</view>

			<view class="date">
				有效期至2020-10-20
			</view>

			<image @click="del" src="../../static/users/delete.png" mode=""></image>
		</view>

		<view class="over" @click="over">
			新增
		</view>


		<view class="bottom"></view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				list: [{
					price: 541
				}, {
					price: 51
				}, {
					price: 41
				}, {
					price: 31
				}],
				page: 1
			}
		},
		methods: {
			over() {
				this.page++
				if (this.page % 2 == 1) {
					uni.redirectTo({
						url: "../addcoupon/addcoupon"
					})
				} else {
					uni.showModal({
						content: "你当前暂无空白优惠券，是否立即购买",
						success: res => {
							if (res.confirm) {
								uni.redirectTo({
									url: "../buycoupon/buycoupon"
								})
							} 
						}
					})
				}

			},
			del() {
				console.log(11);
			},
			
		}
	}
</script>

<style lang="scss">
	.over {
		position: fixed;
		bottom: 50rpx;
		left: 30rpx;
		width: 690rpx;
		height: 100rpx;
		background: #181818;
		box-shadow: 0px 10rpx 40rpx 0px rgba(24, 24, 24, 0.26);
		border-radius: 50rpx;

		text-align: center;
		line-height: 100rpx;

		font-size: 32rpx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
	}

	.quan {
		margin-top: 30rpx;
		margin-left: 40rpx;
		width: 670rpx;
		height: 196rpx;
		background: #F2F4FA;
		border-radius: 30rpx;
		position: relative;

		image {
			position: absolute;
			top: 73rpx;
			right: 60rpx;
			width: 50rpx;
			height: 50rpx;
		}

		.ti {
			width: 180rpx;
			height: 40rpx;
			background: #181818;
			border-radius: 25rpx 0px 25rpx 0px;
			text-align: center;
			line-height: 40rpx;
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #FFFFFF;
		}

		.price {
			position: absolute;
			top: 72rpx;
			left: 35rpx;
			font-size: 60rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #FF4646;

			text {
				font-size: 24rpx;
			}
		}

		.use {
			position: absolute;
			top: 72rpx;
			left: 204rpx;
			font-size: 24rpx;
			font-family: PingFang SC;
			font-weight: 500;
			color: #000000;
		}

		.date {
			position: absolute;
			top: 115rpx;
			left: 204rpx;
			font-size: 20rpx;
			font-family: PingFang SC;
			font-weight: 400;
			color: #666666;
		}

		.radio {
			position: absolute;
			right: 13rpx;
			top: 73rpx;
		}

	}

	.bottom {
		width: 750rpx;
		height: 493rpx;
	}
</style>
